home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group99a.txt / 000185_icon-group-sender _Thu Sep 2 17:07:22 1999.msg < prev    next >
Internet Message Format  |  2000-09-20  |  4KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id RAA05171
  4.     for icon-group-addresses; Thu, 2 Sep 1999 17:07:01 -0700 (MST)
  5. Message-Id: <199909030007.RAA05171@baskerville.CS.Arizona.EDU>
  6. X-Sender: memphis@popmail.macconnect.com
  7. Date: Thu, 2 Sep 1999 17:17:45 -0500
  8. To: "Frank Lhota" <lhotaf@lexma.meitech.com>,
  9.         <icon-group@optima.CS.Arizona.EDU>
  10. From: Garry <memphis@macconnect.com>
  11. Subject: Re: Is open(..,"b") broken in MPW Icon 9.0?
  12. X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id PAA20871
  13. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  14. Status: RO
  15.  
  16. At 12:32 -0400 1999-09-02, Frank Lhota wrote:
  17. >The Icon file management routines are based on the C <stdio.h> facilitates.
  18. >The Icon open mode specifications are mapped to the C fopen mode parameter,
  19. >and unfortunately the available fopen modes vary from platform to platform.
  20. >
  21. >Do you have a C compiler for the Macintosh MPW environment? If so, try to
  22. >see which C fopen modes will give you the desired results. From this, we can
  23. >figure out the how to fix the Icon run time code.
  24.  
  25. Thanks for your response Frank. I don't quite understand; the mode to pass to fopen for updating a file is "r+" on every platform (the lower level Mac toolbox call is something funky but the standard C library function is "standard").  I checked the "r+" mode on my problem file using a C program.   "f = fopen( "Testfile", "r+" );" works fine.   Thereafter I can read lines with fgets() or write to random locations using fseek() and fprintf() or fputs().
  26.  
  27. Of course I'm using an up-to-date StdCLib (I'm using MacOS 8.6 and MPW / MrC with Universal Interfaces 3.2).  I'm also using the new file system, HFS+, which (I hope) is transparent at the level of standard C functions.  Maybe MPW Icon (9.0)  just needs to be recompiled against new libraries -- but that's easier said than done.  It would become somewhat larger (because of changing from 68K to PowerPC RISC instructions) and much faster.  Would anyone be willing to help me?  
  28.  
  29. (As for my immediate problem -- it is perhaps most simply solved by using Icon for the analysis and reporting functions, in which it excels, and dropping back to C for writing my files in the first place. Since what I'm working on is a notekeeper/outliner to use in my MPW programming environment, I can tie Icon and C programs together using the Shell.)
  30.  
  31.  
  32. >----- Original Message -----
  33. >From: Garry <memphis@macconnect.com>
  34. >
  35. >> The most up-to-date Icon available for the Macintosh MPW environment is
  36. >> version 9.0, which I think may have been implemented by Bob Alexander
  37. >> (email address?). I've implemented most of an outline processor / note
  38. >> organizer for MPW using Icon; maybe I'll proceed to try using it for
  39. >> keeping source code in outline form, BUT after more than a month of fun
  40. >> with Icon I've run into a problem!!  I can't open a file for update
  41. >> (read/write).  When I follow the Icon practice of opening my file with
  42. >> "b" mode I find that I can read it but I can not write to the file.  For
  43. >> example if I execute
  44. >>    f := open( "Testfile", "b" )
  45. >>    seek( f )
  46. >>    writes( f, "**" )
  47. >> where "Testfile" is a small test file created previously, then I get the
  48. >> message
  49. >>    Run-time error 214
  50. >>    input/output error
  51. >>
  52. >> I've tried specifying "r+" mode or "b+r" or "ub" mode without success.
  53.  
  54. -- 
  55.    Garry Roseman  <mailto:memphis@macconnect.com>
  56.    Tech Writer & Freelance Programmer
  57.    Memphis, TN USA
  58.  
  59.  
  60.